home *** CD-ROM | disk | FTP | other *** search
/ MPEG Toolkit / MPEG Toolkit.iso / dos / ampeg43 / source / decodsrc / decoder.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-01  |  8.1 KB  |  179 lines

  1. /**********************************************************************
  2. Copyright (c) 1991 MPEG/audio software simulation group, All Rights Reserved
  3. decoder.h
  4. **********************************************************************/
  5. /**********************************************************************
  6.  * MPEG/audio coding/decoding software, work in progress              *
  7.  *   NOT for public distribution until verified and approved by the   *
  8.  *   MPEG/audio committee.  For further information, please contact   *
  9.  *   Davis Pan, 708-538-5671, e-mail: pan@ukraine.corp.mot.com        *
  10.  *                                                                    *
  11.  * VERSION 4.3                                                        *
  12.  *   changes made since last update:                                  *
  13.  *   date   programmers         comment                               *
  14.  * 2/25/91  Doulas Wong,        start of version 1.0 records          *
  15.  *          Davis Pan                                                 *
  16.  * 5/10/91  Vish (PRISM)        Renamed and regrouped all ".h" files  *
  17.  *                              into "common.h" and "decoder.h".      *
  18.  *                              Ported to Macintosh and Unix.         *
  19.  * 27jun91  dpwe (Aware)        New prototype for out_fifo()          *
  20.  *                              Moved "alloc_*" stuff to common.h     *
  21.  *                              Use ifdef PROTO_ARGS for prototypes   *
  22.  *                              prototypes reflect frame_params struct*
  23.  * 10/3/91  Don H. Lee          implemented CRC-16 error protection   *
  24.  * 2/11/92  W. Joseph Carter    Ported new code to Macintosh.  Most   *
  25.  *                              important fixes involved changing     *
  26.  *                              16-bit ints to long or unsigned in    *
  27.  *                              bit alloc routines for quant of 65535 *
  28.  *                              and passing proper function args.     *
  29.  *                              Removed "Other Joint Stereo" option   *
  30.  *                              and made bitrate be total channel     *
  31.  *                              bitrate, irrespective of the mode.    *
  32.  *                              Fixed many small bugs & reorganized.  *
  33.  *                              Modified some function prototypes.    *
  34.  * 08/07/92 Mike Coleman        Made small changes for portability    *
  35.  * 9/07/93  Toshiyuki Ishino    Integrated with Layer III.            *
  36.  * 11/04/94 Jon Rowlands        fix protos for usage() and            *
  37.  *                              recover_CRC_error()                   *
  38.  **********************************************************************/
  39.  
  40. /***********************************************************************
  41. *
  42. *  Decoder Include Files
  43. *
  44. ***********************************************************************/
  45.  
  46. /***********************************************************************
  47. *
  48. *  Decoder Definitions
  49. *
  50. ***********************************************************************/
  51.  
  52. #define   DFLT_OPEXT        ".dec"  /* default output file name extension */
  53. /*
  54.  NOTE: The value of a multiple-character constant is
  55.  implementation-defined.
  56. */
  57. #if !defined(MS_DOS) && !defined(AIX)
  58. #define   FILTYP_DEC_AIFF   'AIFF'
  59. #define   FILTYP_DEC_BNRY   'TEXT'
  60. #define   CREATR_DEC_AIFF   'Sd2a'
  61. /*
  62.   The following character constant is ASCII '????'
  63.   It is declared in hex because the character
  64.   constant contains a trigraph, causing an error in
  65.   parsing with ANSI preprocessors.
  66. */
  67. #define   CREATR_DEC_BNRY   0x3f3f3f3f
  68. #else
  69. #define   FILTYP_DEC_AIFF   "AIFF"
  70. #define   FILTYP_DEC_BNRY   "TEXT"
  71. #define   CREATR_DEC_AIFF   "Sd2a"
  72. #define   CREATR_DEC_BNRY   "????"
  73. #endif
  74.  
  75. #define   SYNC_WORD         (long) 0xfff
  76. #define   SYNC_WORD_LNGTH   12
  77.  
  78. #define   MUTE              0
  79.  
  80. /***********************************************************************
  81. *
  82. *  Decoder Type Definitions
  83. *
  84. ***********************************************************************/
  85.  
  86. /***********************************************************************
  87. *
  88. *  Decoder Variable External Declarations
  89. *
  90. ***********************************************************************/
  91.  
  92. /***********************************************************************
  93. *
  94. *  Decoder Function Prototype Declarations
  95. *
  96. ***********************************************************************/
  97.  
  98. /* The following functions are in the file "musicout.c" */
  99.  
  100. #ifdef   PROTO_ARGS
  101. static void   usage(void);
  102. #else
  103. static void   usage();
  104. #endif
  105.  
  106. /* The following functions are in the file "decode.c" */
  107.  
  108. #ifdef   PROTO_ARGS
  109. extern void   decode_info(Bit_stream_struc*, frame_params*);
  110. extern void   II_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  111.                        frame_params*);
  112. extern void   I_decode_bitalloc(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  113.                        frame_params*);
  114. extern void   I_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  115.                        unsigned int[2][3][SBLIMIT], frame_params*);
  116. extern void   II_decode_scale(Bit_stream_struc*, unsigned int[2][SBLIMIT],
  117.                        unsigned int[2][SBLIMIT], unsigned int[2][3][SBLIMIT],
  118.                        frame_params*);
  119. extern void   I_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  120.                        unsigned int[2][SBLIMIT], frame_params*);
  121. extern void   II_buffer_sample(Bit_stream_struc*, unsigned int[2][3][SBLIMIT],
  122.                        unsigned int[2][SBLIMIT], frame_params*);
  123. extern void   read_quantizer_table(double[17], double[17]);
  124. extern void   II_dequantize_sample(unsigned int[2][3][SBLIMIT], 
  125.                        unsigned int[2][SBLIMIT], double[2][3][SBLIMIT],
  126.                        frame_params*);
  127. extern void   I_dequantize_sample(unsigned int[2][3][SBLIMIT],
  128.                        double[2][3][SBLIMIT], unsigned int[2][SBLIMIT],
  129.                        frame_params*);
  130. extern void   read_scale_factor(double[SCALE_RANGE]);
  131. extern void   II_denormalize_sample(double[2][3][SBLIMIT],
  132.                        unsigned int[2][3][SBLIMIT], frame_params*, int);
  133. extern void   I_denormalize_sample(double[2][3][SBLIMIT],
  134.                        unsigned int[2][3][SBLIMIT], frame_params*);
  135. extern void   create_syn_filter(double[64][SBLIMIT]);
  136. extern int    SubBandSynthesis (double*, int, short*);
  137. extern void   read_syn_window(double[HAN_SIZE]);
  138. extern void   window_sample(double*, double*);
  139. extern void   out_fifo(short[2][SSLIMIT][SBLIMIT], int, frame_params*, int,
  140.                        FILE*, unsigned long*);
  141. extern void   buffer_CRC(Bit_stream_struc*, unsigned int*);
  142. extern void   recover_CRC_error(short[2][SSLIMIT][SBLIMIT], int, frame_params*,
  143.                        FILE*, unsigned long*);
  144. extern void   III_dequantize_sample(long int[SBLIMIT][SSLIMIT],
  145.             double [SBLIMIT][SSLIMIT], III_scalefac_t *,
  146.                         struct gr_info_s *, int, frame_params *);
  147. extern void   III_antialias(double[SBLIMIT][SSLIMIT], double[SBLIMIT][SSLIMIT], 
  148.                           struct gr_info_s *, frame_params *);
  149. extern void   inv_mdct(double[18], double[36], int);
  150. extern void   III_hybrid(double[SSLIMIT], double[SSLIMIT] , int, int,
  151.                        struct gr_info_s *, frame_params *);
  152.  
  153. #else
  154. extern void   decode_info();
  155. extern void   II_decode_bitalloc();
  156. extern void   I_decode_bitalloc();
  157. extern void   I_decode_scale();
  158. extern void   II_decode_scale();
  159. extern void   I_buffer_sample();
  160. extern void   II_buffer_sample();
  161. extern void   read_quantizer_table();
  162. extern void   II_dequantize_sample();
  163. extern void   I_dequantize_sample();
  164. extern void   read_scale_factor();
  165. extern void   II_denormalize_sample();
  166. extern void   I_denormalize_sample();
  167. extern void   create_syn_filter();
  168. extern int    SubBandSynthesis ();
  169. extern void   read_syn_window();
  170. extern void   window_sample();
  171. extern void   out_fifo();
  172. extern void   buffer_CRC();
  173. extern void   recover_CRC_error();
  174. extern void   III_dequantize_sample();
  175. extern void   III_antialias();
  176. extern void   inv_mdct();
  177. extern void   III_hybrid();
  178. #endif
  179.